﻿using JZNJ.RadioMonitorServer.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JZNJ.RadioMonitorServer.App
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DeviceManager m_controller = new DeviceManager();
            
            FrmRoot fr = new FrmRoot();
            fr.StartPosition = FormStartPosition.CenterScreen;
            fr.Show();

            m_controller.FindEquipment();
            m_controller.ConnectEquipment();

            //USRPDevice device = new USRPDevice(IPAddress.Parse("192.168.10.2"), (float)(10E+6));
            //device.RefreshState();
            //DeviceManager.Instance.InitDeviceList();
            //DeviceManager.Instance.StartGetData();
            //TestUSRP();

            Application.DoEvents();
            fr.Close();
            Application.Run(new FrmEquipment());
        }


        private static void TestUSRP()
        {
            //USRPDevice device = new USRPDevice(IPAddress.Parse("192.168.10.2"));
            double start = 1.59E+9;
            double tap = 0.003E+9;
            for (int i = 0; i < 1000; i++)
            {
                //device.RefreshState(start, start + tap, tap, 10E+6);
                start += tap;
                //Console.WriteLine(device.Info.Values[0].ToString());
            }
        }
    }
}
